<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddCompanyToCheckFiles extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('check_files', function (Blueprint $table) {
            $table->unsignedInteger('company')->default(0)->comment('公司账号id')->after('payChannel');
        });

        \App\Kuafu\Pay\Model\CheckFileModel::query()->update(['company' => \App\Kuafu\Pay\Service\PayConfigService::COMPANY_FRIED_IDEA]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('check_files', function (Blueprint $table) {
            $table->dropColumn('company');
        });
    }
}
